package com.deuwise.system.service;

import com.deuwise.system.entity.BackUpDo;
import com.baomidou.mybatisplus.service.IService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;

/**
 *@author deuwise
 *@date 2018-11-14 11:26:52
 * 数据备份 接口类
 **/
public interface BackUpDoService extends IService<BackUpDo>{

    /**
     * 备份操作
     * @param request
     * @return
     * @throws IOException
     * @throws ClassNotFoundException
     * @throws SQLException
     */
    String backupData(HttpServletRequest request) throws IOException, ClassNotFoundException, SQLException;

    /**
     * 备份名称查询总数
     * @param name
     * @param backUpDo
     * @return
     */
    Integer queryByName(String name, BackUpDo backUpDo);

    /**
     * 下载备份文件
     * @param response
     * @param backUpDo
     */
    void downloadFile(HttpServletResponse response,BackUpDo backUpDo);


    /**
     * 设置备份信息
     * @param backUpDo
     * @param backUrl
     */
    void setBackUpData( BackUpDo backUpDo,String backUrl);


}